****
****	GSS replication.do
****
****
****	The script below replicates the GSS portion of the paper:
****	"Depression and Political Participation" forthcoming in Social Science Quaterly
****
****

**
** Read in data-- need to set path file name

*cd "PATH FILE NAME HERE"
use "GSS_replication.dta", clear


**
** Determining sample size based on final model specification
svyset [weight=wtssall]			 	 
svy: logistic vote96 mhealth_scale_top female black otherrace age educ inc10 married party_strength health_ex health_good attend happy_pty happy_very	
predict y_samp


**
** Descriptive statistics

* percent voting
sum vote96 if y_samp != . [aw=wtssall]

* alpha score of depression items
alpha mhealth1 mhealth4 mhealth5 mhealth6 if y_samp != . & vote96 != ., item 

* mean and sd of transformed depressed mood scale
sum mhealth_scale_top if y_samp != . & vote96 != .  [aw=wtssall]

* plot of loess line showing voting (1996) across values of the depressed mood scale
graph twoway (hist mhealth_scale_top if y_samp != . & vote96 != ., discrete percent fcolor(black)  lcolor(gs14)  yaxis(2)) ///
		(lowess vote96 mhealth_scale_top if y_samp != . & vote96 != ., clwidth(medthick) clpattern(dash) clcolor(red) yaxis(1)), ///
			 legend(off) ///
			 xtitle("Depressed Mood", size(4)) ///
			 ytitle("Probability of Voting", orientation(rvertical) axis(1) size(4)) ///
			 ytitle(Percentage of Observations, axis(2) size(4)) ///
			 ylabel(0 0.25 0.5 0.75, axis(1) labsize(2.5) angle(horizontal)) ///
			 ylabel(0 5 10 15 20 25, axis(2) labsize(2.5) angle(horizontal)) ///
			 xlabel(0 0.25 0.5 0.75 1, labsize(2.5)) ///
             xsca(titlegap(2)) ///
             ysca(titlegap(2)) ///
             scheme(s2mono) graphregion(fcolor(white)) 

* descriptive statistics of control variables in multivariate analysis
sum vote96 mhealth_scale_top female black otherrace age educ inc10 married party_strength health_ex health_good attend happy_pty happy_very if y_samp != . & vote96 != . [aw=wtssall]	

			
**
** Results of multivariate analysis

* with depression and demographics
svy: logistic vote96 mhealth_sum_top female black otherrace age educ inc10 married	

* with depression and party strength
svy: logistic vote96 mhealth_sum_top female black otherrace age educ inc10 married party_strength

* with depression and general health
svy: logistic vote96 mhealth_sum_top female black otherrace age educ inc10 married health_ex health_good	

* with depression and social capital/church attendance
svy: logistic vote96 mhealth_sum_top female black otherrace age educ inc10 married attend

* with depression and happiness
svy: logistic vote96 mhealth_sum_top female black otherrace age educ inc10 married happy_pty happy_very

* with all
svy: logistic vote96 mhealth_sum_top female black otherrace age educ inc10 married party_strength health_ex health_good attend happy_pty happy_very
prchange, rest(median)


**
** Endnotes

* calculation of VIF
reg mhealth_sum_top female black otherrace age educ inc10 married party_strength health_ex health_good attend happy_pty happy_very
display "tolerance = " 1-e(r2) " VIF = " 1/(1-e(r2))

* no top-coding of depression mood		 
svy: logistic vote96 mhealth_sum female black otherrace age educ inc10 married party_strength health_ex health_good attend happy_pty happy_very	 

* severity measure with top-coding of depressed mood	 
svy: logistic vote96 mhealth_sum_top mhealth_sev female black otherrace age educ inc10 married party_strength health_ex health_good attend happy_pty happy_very
			 
* logged depressed mood	 
svy: logistic vote96 mhealth_log female black otherrace age educ inc10 married party_strength health_ex health_good attend happy_pty happy_very

* age X depressed mood interaction 
svy: logistic vote96 c.mhealth_sum_top##c.age female black otherrace educ inc10 married party_strength health_ex health_good attend happy_pty happy_very

* trichotomized age X depressed mood interaction	 
svy: logistic vote96 c.mhealth_scale_top##age_young c.mhealth_scale_top##age_old female black otherrace educ inc10 married party_strength health_ex health_good attend happy_pty happy_very
